package com.zbkj.crmeb.enums;

import java.util.Objects;

/**
 * 功能描述: 商户注册 快递发货方式
 * @Author: wangzh
 * @Date: 2023/4/24 16:46
 */
public enum DeliveryTypeEnum {

    DELIVERY(1, "快递"),

    LOCAL_TOWN_DELIVERY(2, "同城配送"),

    HOME_PICKUP(3, "客户上门自提"),
    ;

    private final Integer code;

    private final String msg;

    DeliveryTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static DeliveryTypeEnum getMsgByCode(Integer code) {
        for (DeliveryTypeEnum value : values()) {
            if (Objects.equals(value.getCode(), code)) {
                return value;
            }
        }
        return null;
    }
}
